import { createRouter, createWebHistory } from "vue-router";
import Home from "../pages/home/Home.vue";
import SearchPage from "@/pages/search/SearchPage.vue";
import DetailPage from "@/pages/search/DetailPage.vue";
import Maftools from "@/pages/maftools/Maftools.vue";
import RNASeqtools from "@/pages/rnaseqtools/RNASeqtools.vue";
import Login from "@/pages/user/Login.vue";
import Register from "@/pages/user/Register.vue";
import UserPage from "@/pages/user/UserPage.vue";
import TaskPage from "@/pages/user/TaskPage.vue";

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            name: 'home',
            component: Home
        },
        {
            path: '/search',
            name: 'search',
            meta: {
                keepAlive: true
            },
            component: SearchPage
        },
        {
            path: '/search/:SampleID',
            name: 'search-detail',
            component: DetailPage
        },
        {
            path: '/maftools/:taskid',
            name: 'maftools',
            component: Maftools
        },
        {
            path: '/rnaseqtools/:taskid',
            name: 'rnaseqtools',
            component: RNASeqtools
        },
        {
            path: '/login',
            name: 'login',
            component: Login
        },
        {
            path: '/register',
            name: 'register',
            component: Register
        },
        {
            path: '/userpage',
            name: 'userpage',
            component: UserPage
        },
        {
            path: '/taskpage',
            name: 'taskpage',
            component: TaskPage
        }
    ]
});

export default router;
